package com.yystar.security.support.jdbc;

import java.io.Serializable;
import java.util.List;

/**
 * 
 * @author Vistaa Peng
 * @date 2013-6-27
 * @todo TODO
 * @modify	<BR>
 * 1.2013-6-27 Vistaa Peng Create file.
 */
public class Pager<T> implements Serializable {
	private static final long serialVersionUID = -3601444479947976575L;

	private int pageSize; // record number of per page
	private int pageIndex = 1; // current page number
	private int pageSum = 1; // total page number
	private int totalCount = 0;// total record number
	private List<T> resultList; // result set
	
	public Pager(int totalCount, int pageSize) {
		this.totalCount = totalCount;
		this.pageIndex = 1;
		this.pageSum = 1;
		this.pageSize = pageSize;
		this.resultList = null;
	}
	
	public Pager(int totalCount, int pageNo, int pageSum, int pageSize, List<T> resultList) {
		this.totalCount = totalCount;
		this.pageIndex = pageNo;
		this.pageSum = pageSum;
		this.pageSize = pageSize;
		this.resultList = resultList;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
		
	public int getPageNo() {
		return pageIndex;
	}

	public void setPageNo(int pageNo) {
		this.pageIndex = pageNo;
	}

	public int getPageSum() {
		return pageSum;
	}

	public void setPageSum(int pageSum) {
		this.pageSum = pageSum;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public List<T> getResultList() {
		return resultList;
	}

	public void setResultList(List<T> resultList) {
		this.resultList = resultList;
	}
}
